package com.md.controller;

import com.md.entity.DeptInfo;
import com.md.service.UserService;
import lombok.Data;

import java.util.List;

@Data
public class UserController {
    private UserService userService;
    public String deleteOneUserById(int id){
        Boolean rs = userService.removeUserById(id);
        return rs ? "删除成功" : "删除失败";
    }
    public DeptInfo getOneUserById(int id){
        DeptInfo userId = userService.getUserId(id);
        userId.setDid(3);
        return userId;
    }
    public List<DeptInfo> selectAllDept(){return userService.selectAllDept();}
    public String insertDept(DeptInfo deptInfo){return userService.insertDept(deptInfo)?"添加成功" : "添加失败";}
}
